package com.zhuss.advice.complaintSon;

import com.zhuss.advice.processor.ProposalRead;
import com.zhuss.bean.bo.advice.proposal.DetailProposalBo;
import com.zhuss.bean.bo.advice.proposal.SearchProposalBo;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/6 9:27
 */
@Component("complaintSonReadService")
public class ComplaintSonReadService implements ReadService<Object, Object> {

    @Autowired
    @Qualifier("proposalRead")
    private ProposalRead proposalRead;

    @Override
    public Object detail(Object o) throws WpsException {
        DetailProposalBo bo = (DetailProposalBo) o;
        Object result = proposalRead.detail(bo.getProposalId());
        return result;
    }

    @Override
    public Object list(Object o) throws WpsException {
        SearchProposalBo bo = (SearchProposalBo) o;
        Object result = proposalRead.list(bo);
        return result;
    }

    /**
     * 意见回复列表
     * @param o
     * @return
     * @throws WpsException
     */
    public Object replyList(Object o) throws WpsException {
        SearchProposalBo bo = (SearchProposalBo) o;
        Object result = proposalRead.list(bo);
        return result;
    }
}
